class OrgsMembers
  attr_accessor :github

  def initialize(github)
    @github = github
  end

  def listMembers(org)
    @github.get('orgs/%s/members' % org)
  end

  def getMember(org, user=nil)
    username = user == nil ? @github.username : user
    @github.get('orgs/%s/members/%s' % [org, username])
  end

  def removeMember(org, user)
    username = user == nil ? @github.username : user
    @github.delete('orgs/%s/members/%s' % [org, username])
  end

  def listPublicMembers(org)
    @github.get('orgs/%s/public_members' % org)
  end

  def getIfUserIsPublic(org, user)
    username = user == nil ? @github.username : user
    @github.get('orgs/%s/public_members/%s' % [org, username])
  end

  def publicizeUser(org, user)
    username = user == nil ? @github.username : user
    @github.put('orgs/%s/public_members/%s' % [org, username])
  end

  def concealUser(org, user)
    username = user == nil ? @github.username : user
    @github.delete('orgs/%s/public_members/%s' % [org, username])
  end
end